import request from '@/config/axios'

// 告警规则 VO
export interface AlarmRuleVO {
  id: number // ID
  name: string // 规则名称
}

// 告警规则 API
export const AlarmRuleApi = {
  // 查询告警规则详情
  getAlarmRule: async (taskId: number) => {
    return await request.get({ url: `/vmiot/alarm-rule/getByTaskId?taskId=` + taskId })
  },

  // 保存告警规则
  saveAlarmRule: async (data: AlarmRuleVO) => {
    return await request.put({ url: `/vmiot/alarm-rule/save`, data })
  }
}
